package inherit;

class Animal{
    public  String name;
    public int age;
    public void eat(){
        System.out.println(name+"正在吃饭！");

    }
}

 class Dog extends Animal{

     public float weight;

 void bark(){
         System.out.println(name+"正在汪汪");
     }
 }
  class Cat extends Animal{



     public void bark(){
         System.out.println(name+"喵喵喵");
     }

  }


public class Test {
    public static void main(String[] args) {
        Dog dog=new Dog();
        dog.name="狗子";
        dog.eat();
        dog.bark();


    }

}








